<template>
  <div class="home">
    <v-header :title="'首页'"></v-header>
    <van-button plain type="primary" @click='detail'>去详情</van-button>
    <div class="content">
      <div class="name">{{content}}</div>
    </div>
  </div>
</template>

<script>
import eventBus from '../libs/event_bus';
import vHeader from "@/components/Header.vue";
// import { Toast} from 'vant';
export default {
  name: "Home",
  components: {
    vHeader,
  },
  data() {
    return {
      content: '',
    }
  },
  mounted() {
    console.log(8888);
    this.content = this.$store.state.main.main;
    eventBus.$on('change', () => {
      this.content = '数据改变了';
      console.log(this.content);
    });
    // Toast.success('成功文案');
  },
  methods: {
    detail() {
      this.$router.push('detail');
    },
  }
};
</script>
<style lang='scss'>
.content{
  font-size: 16px;
}
</style>
